<?php

namespace App\Models;

use Dcat\Admin\Traits\HasDateTimeFormatter;

use Illuminate\Database\Eloquent\Model;

class HospitalAppointVaccine extends Model
{
	use HasDateTimeFormatter;
    protected $table = 'eb_hospital_appoint_vaccine';
    protected $fillable = ['vaccine_id', 'hospital_id','hospital_appoint_id','weeks','week_num','interval_num'];
    public static function booted()
    {
        parent::booted();
        static::creating(function ($model){
            if(empty($model->weeks)){
                $model->weeks = "";
            }
            if(empty($model->week_num)){
                $model->week_num = "";
            }
            if(empty($model->interval_num)){
                $model->interval_num = "";
            }
        });
       
    }

}
